<?php /* Smarty version 2.6.20, created on 2016-07-19 15:22:55
         compiled from free_shipping_express.htm */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>免邮专区</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script>
//保存价格
	function savePrice(snsId,type){
		if(snsId>0){
			if(type=='fee'){
				var price = $('#freeFee_'+snsId).val();
				var act = 'saveFee';
			}else{
				var price = $('#freePrice_'+snsId).val();
				var act = 'savePrice';
			}
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=activity&s=free_shipping_express.php',{"id":snsId,"free_shipping_price":price,"act":act},function(s){
				window.location.reload();
			});
		}
	}

$(function(){
	//改变状态
	$('.changeStatus').click(function(){
		var status = $(this).attr('statusV');
		var id = $(this).attr('dataId');
		if(id>0){
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=activity&s=free_shipping_express.php',{"id":id,"status":status,"act":"changeStatus"},function(s){
				window.location.reload();
			});
		}
	});
});
</script>
</head>
<body>
	<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>免邮专区</h3>
                <ul>
                    <li class="current"><a href="?m=activity&s=free_shipping_express.php"><span>管理</span></a></li>
                </ul>
            </div>
        </div>
        <div class="h35"></div>  
        
    <form action="" method="get">
    <input type="hidden" name="m" value="activity">
    <input type="hidden" name="s" value="free_shipping_express.php">
    <table class="select_table">
        <tbody>
            <tr>
            	<td width="50">仓库:</td>
            	<td width="100">
	                <select name="stock_shop" id="stock_shop" >
	                <option value="" <?php if ($this->_tpl_vars['general_shop'] != 0): ?>disabled<?php endif; ?>>全部</option>
	                <?php $_from = $this->_tpl_vars['stock_shops']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
	                	<option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['stock_shop'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> <?php if ($this->_tpl_vars['general_shop'] != 0 && $this->_tpl_vars['general_shop'] != $this->_tpl_vars['list']['id']): ?>disabled<?php endif; ?>><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
	                <?php endforeach; endif; unset($_from); ?>
	                </select>
                </td>

                <td width="60">状态：</td> 
                <td width="80">
                	<select name="status" id="status">
                		<option value="">全部</option>
                		<option value="1" <?php if ('1' === $_GET['status']): ?>selected="selected"<?php endif; ?>>开启</option>
                		<option value="0" <?php if ('0' == $_GET['status']): ?>selected="selected"<?php endif; ?>>关闭</option>
                	</select>
                </td>
                <td><input type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
            </tr>
            
        </tbody>
    </table>
    </form>

        <table class="table">
        	<thead>
                <tr>
                    <th class="partition" colspan="99">快递列表</th>
                </tr>
            </thead>
            <tbody>
                <tr class="header">
                    <th width="50">ID</th>
                    <th width="100">仓库</th>
                    <th width="150">快递名称</th>
                    <th width="170">产品数量</th>
                    <th width="170">起免金额</th>
                    <th width="170">减免金额</th>
                    <th width="60">状态</th>
                    
                    <th width="100">操作</th>
                </tr>
                <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <tr>
                    <td><?php echo $this->_tpl_vars['list']['id']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['shop_name']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['express_name']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['list']['product_num']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['config']['money']; ?>
<input type="text" id="freePrice_<?php echo $this->_tpl_vars['list']['id']; ?>
" onblur="savePrice(<?php echo $this->_tpl_vars['list']['id']; ?>
);" value="<?php echo $this->_tpl_vars['list']['free_shipping_price']; ?>
"/></td>
                    <td><?php echo $this->_tpl_vars['config']['money']; ?>
<input type="text" id="freeFee_<?php echo $this->_tpl_vars['list']['id']; ?>
" onblur="savePrice(<?php echo $this->_tpl_vars['list']['id']; ?>
,'fee');" value="<?php echo $this->_tpl_vars['list']['free_fee']; ?>
"/></td>
                    <td><?php if ($this->_tpl_vars['list']['status'] == 1): ?><button class="changeStatus" statusV='0' dataId='<?php echo $this->_tpl_vars['list']['id']; ?>
'>开启</button><?php else: ?><button class="changeStatus" statusV='1' dataId='<?php echo $this->_tpl_vars['list']['id']; ?>
'>关闭</button><?php endif; ?></td>
                    <td>
                    	<a href='?m=activity&s=free_shipping_product.php&editid=<?php echo $this->_tpl_vars['list']['id']; ?>
<?php echo $this->_tpl_vars['cond']; ?>
'><?php echo $this->_tpl_vars['setimg']; ?>
</a>
                    </td>
                </tr>
                <?php endforeach; else: ?>
                <tr>
                    <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
                </tr>
                <?php endif; unset($_from); ?>
            </tbody>
            <tfoot>
                <tr>
                	<td colspan="99">
                    	<div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</body>
</html>